<%@ page contentType="text/html; charset=utf-8" %>
<%@page import="java.util.*" %>
<%@page import="com.threeti.jiayusms.domain.model.defaulttemplate.*" %>

<%@ include file="/WEB-INF/jsp/includeTaglib.jsp" %>
        <tr>
          <td>
            <table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="1">
              <tr class="rowHead">
                <td height="20" align="center"><input type="checkbox" id="checkVoiceAll" onclick="javascript:checkAllOrNot1('cbVoiceIds', 'checkVoiceAll');"></td>
                <td height="20" nowrap align="center" class="globalTextBold">语音方式编号</td>
                <td height="20" nowrap align="center" class="globalTextBold">节点</td>	
                <td height="20" nowrap align="center" class="globalTextBold">产品类型</td>	
                <td height="20" nowrap align="center" class="globalTextBold">条件</td>	
                <td height="20" nowrap align="center" class="globalTextBold">条件值</td>	
                <td height="20" nowrap align="center" class="globalTextBold">语音模板编号</td>	
                <td height="20" nowrap align="center" class="globalTextBold">通信规则编号</td>	
                <td height="20" nowrap align="center" class="globalTextBold">通信时间编号</td>	
                <td height="20" nowrap align="center" class="globalTextBold">通信启用</td>				
              </tr>
              <c:if test="${empty voiceMappings}">
               <tr class="rowEven">
                <td colspan="7" align="center" class="globalText">无数据</td>
               </tr>
							</c:if>
                <c:forEach var="voiceMapping" items="${voiceMappings}" varStatus="status">
                 <c:choose>
                  <c:when test="${status.index % 2 == 0}">
                  <tr class="rowEven">
                  </c:when>
                  <c:otherwise>
                  <tr class="rowOdd">
                  </c:otherwise>
                 </c:choose>
                   <td height="20" width="5%" align="center"><input type="checkbox" name="cbVoiceIds" value="${voiceMapping.id}" onclick="javascript:checkPerBox1('cbVoiceIds', 'checkVoiceAll');"></td>
                   <td height="20" class="globalText">${voiceMapping.customId}</td>
                   <%
                   VoiceTemplateMapping voiceMappingObj = (VoiceTemplateMapping)pageContext.getAttribute("voiceMapping");
                   Map nodeMap = (Map)request.getAttribute("nodeMap");
                   Map productTypeMap = (Map)request.getAttribute("productTypeMap");
                   Map conditionTypeMap = (Map)request.getAttribute("conditionTypeMap");
                   Map conditionMap = (Map)request.getAttribute("conditionMap");
                   
                   String voiceNode = voiceMappingObj.getVoiceNode();
                   
                   String productType = voiceMappingObj.getVoiceProductType();
                   String productTypeShow = (String)productTypeMap.get(productType);
                   
                   String conditionType = voiceMappingObj.getVoiceConditionType();
                   String conditionTypeShow = (String)conditionTypeMap.get(conditionType);
                   
                   String condition = voiceMappingObj.getVoiceCondition();                   
                   String conditionShow = (String)conditionMap.get(condition);
                   %>
                   <td height="20" class="globalText"><%= nodeMap.get(voiceNode)%></td>
                   <td height="20" class="globalText"><%= productTypeShow == null || "".equals(productTypeShow) ? "全部" : productTypeShow%></td>
                   <td height="20" class="globalText"><%= conditionTypeShow == null || "".equals(conditionTypeShow) ? "全部" : conditionTypeShow%></td>
                   <td height="20" class="globalText"><%= conditionShow == null || "".equals(conditionShow) ? "全部" : conditionShow%></td>
                   <td height="20" class="globalText">${voiceMapping.voiceTemplate.customId}</td>
                   <td height="20" class="globalText">${voiceMapping.voiceRuleTemplate.customId}</td>
                   <td height="20" class="globalText">${voiceMapping.voiceTimeTemplate.customId}</td>
                   <td height="20" class="globalText">${voiceMapping.voiceCommunicationEnabled ? "是" : "否"}</td>
                 </tr>
                </c:forEach>
              </table>
          </td>
       	</tr>